<?php
ob_start();
require_once '../sub/init.php';
require_once 'chkUadm.php';
if(!in_array('qun',$QXARR))exit(noauth());
$nav='index';
require_once ZEAI.'m/div_left_so.php';?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_ADM['admSiteName']; ?></title>
<?php echo HEADMETA; ?>
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<?php require_once 'm_style.php';?>
<link href="css/m_adm.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
.ZEAI_list{padding:70px 0 80px;width:92%;margin:0 auto}
.ZEAI_list dl{width:100%;margin:0 auto 20px auto;border-radius:8px;background-color:#fff;box-shadow:0 0 24px rgb(0 0 0 / 8%);position:relative;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;position:relative}
.ZEAI_list dl .tbody{padding:0 10px;margin:0 auto 10px auto;line-height:40px;color:#999;border-bottom:#f5f5f5 1px solid;text-align:left}
.ZEAI_list dl .tbody{font-size:12px;text-align:left;color:#999}
.ZEAI_list dl .tbody b{display:inline-block;color:#333;font-weight:normal}
.ZEAI_list dl .tbody .flagbox{float:right;font-size:12px}
.ZEAI_list dl .tbody .flag-1{color:#00f}
.ZEAI_list dl .tbody .flag0{color:#f00}
.ZEAI_list dl .tbody .flag1{color:#45c01a}
.ZEAI_list dl .tbody .flag2{color:#999}
.ZEAI_list dl dt,.ZEAI_list dl dd{float:left;display:block}
.ZEAI_list dl dt{width:50px;padding-left:10px;font-size:14px;text-align:left;line-height:150%}
.ZEAI_list dl dt img.photo_s{width:40px;height:40px;object-fit:cover;-webkit-object-fit:cover;border-radius:50%}
.ZEAI_list dl dd{width:-webkit-calc(100% - 90px);text-align:left}
.ZEAI_list dl dd h6{margin-top:5px;color:#999}
.ZEAI_list dl dd h6 b{color:#f00;font-weight:normal}
.ZEAI_list dl dd h6 font{color:#ccc}
.ZEAI_list dl .datali{margin-top:15px;padding:10px;border-top:#f5f5f5 1px solid;text-align:left;font-size:12px;position:relative}
.ZEAI_list dl .datali .chkbox{position:absolute;right:10px;bottom:10px}
</style>
</head>
<body>
<?php
$SQL = "";
$Skey = trimhtml($Skey);
if (!empty($Skey))$SQL .= " AND ( a.content LIKE '%".dataIO(trimm($Skey),'in')."%' ) ";
if ($t == 'pic')$SQL   .= " AND a.piclist<>'' ";
if (ifint($Skey2))$SQL .= " AND b.id =".$Skey2;
switch ($f) {
	case 'f_1':$SQL = " AND a.flag=-1 ";break;
	case 'f0':$SQL  = " AND a.flag=0 ";break;
	case 'f1':$SQL  = " AND a.flag=1 ";break;
	case 'f2':$SQL  = " AND a.flag=2 ";break;
}
if (ifint($Skey3))$SQL .= " AND ( a.qid=$Skey3 )";
//
$rtt = $db->query("SELECT COUNT(*) FROM ".__TBL_TREND__." a ,".__TBL_USER__." b WHERE a.kind=2 AND a.uid=b.id ".$SQL);
$roww = $db->fetch_array($rtt);
//
$mini_title='群话题管理（'.$roww[0].'）';$mini_class='top_mini4 ';
$mini_L = '<em onClick="zeai.openurl(\'m_adm.php\')"><i class="ico" >&#xeaca;</i><span></span></em>';
require_once ZEAI.'m/top_mini.php';?>
<a class="so" id="user_search"><i class="ico">&#xe66c;</i><span>筛选</span></a>
<form id="www_zeai_cn_FORM" class="ZEAI_list" method="get" action="<?php echo SELF; ?>">
	<?php
	$rt = $db->query("SELECT a.*,b.uname,b.nickname,b.sex,b.grade,b.photo_s,b.photo_f FROM ".__TBL_TREND__." a,".__TBL_USER__." b WHERE a.kind=2 AND a.uid=b.id ".$SQL." ORDER BY a.id DESC LIMIT ".$_ADM['admLimit']);
	$total = $db->num_rows($rt);
	if ($total <= 0 ) {
		echo "<div class='nodataico'><i class='ico'>&#xe608;</i>暂无信息<br><br><a class='aBAI' href='javascript:history.back(-1)'>返回上一步</a></div>";
	} else {
		$page_skin=2;$pagemode='mob';$pagesize=8;require_once ZEAI.'sub/page.php';
		for($i=1;$i<=$pagesize;$i++) {
			$rows = $db->fetch_array($rt,'name');if(!$rows) break;
			$id  = $rows['id'];
			$content = trimhtml(dataIO($rows['content'],'out'));
			$content = str_replace($Skey2,"<font color=red><b>".$Skey2."</b></font>",$content);
			$addtime = YmdHis($rows['addtime']);
			$flag = $rows['flag'];
             $trend_qid = $rows['qid'];
			//
			$uid = $rows['uid'];
			$nickname  = dataIO($rows['nickname'],'out');
			$photo_s   = $rows['photo_s'];
			$sex       = $rows['sex'];
			$grade     = $rows['grade'];
			$agreenum  = $rows['agreenum'];
			$photo_s_url = (!empty($photo_s))?UP.smb($photo_s,'s'):RES.'photo_s'.$sex.'.png';
			switch ($flag) {
				case -1:$flag_str= '隐藏';$flag_cls= ' flag-1';break;
				case 0:$flag_str = "<i class='ico'>&#xe65b; 未审核</i>";$flag_cls= ' flag0';break;
				case 1:$flag_str = "<i class='ico'>&#xe67f; 正常</i>";$flag_cls= ' flag1';break;
			}?>
            <dl id="tr<?php echo $id;?>">
            	<div class="tbody">
                	<b><?php echo uicon($sex.$grade);?><?php echo $uid;?></b>（<?php echo $nickname;?>）
                    <div class="flagbox<?php echo $flag_cls;?>"><?php echo $flag_str;?></div>
                </div>
                <dt><a href="javascript:ZeaiM.piczoom('<?php echo smb($photo_s_url,'b');?>');"><img class="photo_s" src="<?php echo $photo_s_url;?>"></a></dt>
                <dd>
                	<h5><?php echo $content;?></h5>
                    <h6>
                    点赞数：<b><?php echo $agreenum;?></b>
					<?php 
                    if($trend_qid){
                        $row = $db->ROW(__TBL_QUN__,"title","id=".$trend_qid,"num");
                        if ($row)echo '<div class="tiaose FR">来自《'.trimhtml(dataIO($row[0],'out')).'，id:'.$trend_qid.'》</div>';
                    }
                    ?>
          			 </h6>
                </dd>
                <div class="clear"></div>
                <div class="datali">
                	<h6 class="C999"><?php echo $addtime;?></h6>
                    <div class="chkbox">
                    <input type="checkbox" name="list[]" value="<?php echo $id; ?>" uid="<?php echo $uid; ?>" id="id<?php echo $id; ?>" class="checkskin"><label for="id<?php echo $id; ?>" class="checkskin-label"><i class="i1"></i></label>
                    </div>
                </div>
            </dl>
			<?php
		}
	}
	?>
</form>
<script>var bg = '<?php echo $_Style['list_bg']; ?>',overbg   = '<?php echo $_Style['list_overbg']; ?>',selectbg = '<?php echo $_Style['list_selectbg']; ?>';</script>
<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="<?php echo SELF;?>" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="Skey" type="text" class="input" id="Skey" maxlength="20" value="<?php echo $Skey;?>" placeholder="按群话题内容" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
    	<div class="form_uid">
        <input name="Skey2" type="text" class="input" id="Skey2" maxlength="20" value="<?php echo $Skey2;?>" placeholder="按用户UID" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
    	<div class="form_uid">
        <input name="Skey3" type="text" class="input" id="Skey3" maxlength="20" value="<?php echo $Skey3;?>" placeholder="按群ID号" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <?php
		div_left_so_out(array('tbody'=>'状态','t'=>'f','tv'=>$f,'subkind'=>2,'newarr'=>json_decode('[{"i":"f1","v":"正常"},{"i":"f0","v":"未审"},{"i":"f_1","v":"隐藏"}]'),'ulcls'=>' col3'));
		?>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so')">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
    </form>
</div>
<script>user_search.onclick=function(){ZeaiM.div_left({obj:user_so,w:28});}</script>
<!--div_left_so end-->
<?php if ($total > 0 ) {?>
<div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<?php echo $page_cls;?>
<div class="listbottombox">
	<input type="checkbox" id="checkboxall2" class="checkskin checkboxall"><label for="checkboxall2" class="checkskin-label"><i class="i1"></i></label>&nbsp;&nbsp;
    <button type="button" id="btnflaglist" class="btn size2 zeaibg disabled action">通过</button>&nbsp;
    <button type="button" id="btn_hide_list" class="btn size2 HUI disabled action">隐藏</button>&nbsp;
    <button type="button" id="btndellist" class="btn size2 HEI2 disabled action">删除</button>
	<?php if ($total > $pagesize)echo '<div class="pagebox">'.$pagelist.'</div>'; ?>
</div>
<script>
o('btndellist').onclick = function() {
	allList({
		btnobj:this,
		url:'qun_trend'+zeai.ajxext+'submitok=delupdate',
		title:'删除',
		msg:'删除中...',
		ifjson:true,
		ifconfirm:true
	});	
}
o('btnflaglist').onclick = function() {
	allList({
		btnobj:this,
		url:'qun_trend'+zeai.ajxext+'submitok=dataflag1',
		title:'审核',
		content:'',
		msg:'处理中...',
		ifjson:true,
		ifconfirm:false
	});	
}
o('btn_hide_list').onclick = function() {
	allList({
		btnobj:this,
		url:'qun_trend'+zeai.ajxext+'submitok=flag_1',
		title:'隐藏',
		content:'',
		msg:'隐藏处理中...',
		ifjson:true,
		ifconfirm:false
	});	
}
</script>
<script src="js/zeai_tablelist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php }?>
</body></html><?php ob_end_flush();?>